package person.xjl.spring;

import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;
import org.springframework.stereotype.Controller;
import org.springframework.stereotype.Repository;
import org.springframework.stereotype.Service;

import java.util.ArrayList;
import java.util.List;
import java.util.Map;

@Getter@Setter
@ToString
//Spring容器会创建一个名字叫ahao的Bean对象
//Bean四种类型：Controller 控制器,Service 业务层对象,Repository 存储层对象
// Component表示所有组件
@Component("aHao")
public class Human {
    @Value("HuangShiHao")
    private String name;
    //属性自动注入
    @Autowired
    //自动注入的对象的名字
       private List<Car> cars;
}
